﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no,email=no,adress=no"/>
<title>先花花</title>
<link rel="stylesheet" type="text/css" href="css/setting.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" src="script/common.js"></script>
<script type="text/javascript" src="script/jquery.md5.js"></script>
<script type="text/javascript" src="script/jquery.cookie.js"></script>
<script type="text/javascript">
  $(function(){
    get_realName();
    $("#btn").click(function(){
      name = $("#realName").val();
      idcard = $("#idCard").val();
      if(regular_idcard()&&regular_name()){
        verify();
      }
    });
  })
  function regular_idcard(){
      var reg = /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i;
      if (!reg.test(idcard)) {  
          $("#carderror").empty();
          $("#carderror").append("身份证格式不正确");
          return false;
      } else {  
        $("#carderror").empty();
          return true;  
      }  
  }
  function regular_name(){
      var reg = /^[\u4E00-\u9FA5]+$/; 
      if (!reg.test(name)) {  
          $("#nameerror").empty();
          $("#nameerror").append("只支持中文");
          return false;
      } else {  
        $("#nameerror").empty();
          return true;  
      }  
  }
  function get_realName(){
    $.ajax({
          url:commonUrl+"/Userinfo/index",
          data:{appid:appid,appkey:appkey,uid:uid},
          type:"get",
          dataType:"jsonp",
          jsonp:"callback",
          success:function(result){
            if(result.data.realName){
              $("#realName").val(result.data.realName);
              $("#idCard").val(result.data.idCard);
              $('#realName').attr("disabled",true);
              $('#idCard').attr("disabled",true);
              $('#btn').attr("disabled",true);
            }
          }
      });
  }
  function verify(){
    $.ajax({
          url:commonUrl+"/Idcord/index",
          data:{appid:appid,appkey:appkey,name:name,uid:uid,idcard:idcard},
          type:"get",
          dataType:"jsonp",
          jsonp:"callback",
          success:function(result){
            alert(result.reason);
          }
      });
  }
</script>
</head>
<body>
<!-- 页面头部 -->
<section>
<div class="navigation-bar"> <a href="javascript:history.back(-1)" class="z-01"></a> <span>投资记录</span> <a href="index.html" class="z-02"></a> </div>
</section>
<!-- 中间内容 -->
<div class="m-wrapper">
  <div class="wrapper   ">
    <div class="login-password real-name">
      <div class="container-fluid">
        <form class="login-form2" id="set-real-name" onSubmit="return false;">
          <div class="form-group item">
            <input type="text" class="form-control input-lg rel-name login-input" id="realName" tabindex="1" placeholder="请输入真实姓名" value=""><label id="nameerror"></label>
          </div>
          <div class="form-group item">
            <input type="text" class="form-control card-id input-lg" id="idCard" tabindex="2" placeholder="请输入身份证号" value=""><label id="carderror"></label>
          </div>
          <div class="tip-info">
            <p class="text-left ui-fs-12 text-nowrap">请仔细确认，认证后的账号不能修改认证信息</p>
          </div>
          <div class="form-group">
            <button type="button" data-toggle="modal" class="waves-button form-control login-button input-lg  default waves-effect waves-effect" tabindex="4" id="btn">确定</button>
          </div>
        </form>
		<div>
          <p class="text-center ui-fs-12 text-nowrap">若您无法通过该方式重设手机号码，请联系客服电话</p>
          <p class="text-center ui-fs-12 text-nowrap"><span>400-090-1268</span></p>
        </div>
      </div>
    </div>
  </div>

</div>
<!-- 页面底部 -->
<nav class="footer border_t" id="footer"> 
  <a href="index.html" class="" id="jx"><span></span>首页</a>
   <a href="list.html" id="lc" class=""><span></span>理财</a> 
  <a href="borrow_money.html" id="jk" class=""><span></span>借款</a>
   <a href="user.html" id="cf" class="nav_on"><span></span>我的账户</a> </nav>
</body>
</html>
